using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ResourceManager : TSingleton<ResourceManager>
{
    Canvas mCanvas;
    Transform mHeroRoot;
    UIHero mHeroUIPrefab;

    Transform mFormRoot;
    GameObject mForm2Prefab;

    public UIHero CreateHeroUI()
    {
        if (mHeroUIPrefab == null)
        {
            mHeroUIPrefab = Resources.Load<UIHero>("HeroUI");
            mCanvas = GameObject.FindObjectOfType<Canvas>();
            mHeroRoot = GameObject.Find("UIHeroRoot").transform;
        }
        return GameObject.Instantiate(mHeroUIPrefab, mHeroRoot);
    }

    public GameObject CreateFormBox2()
    {
        if (mForm2Prefab == null)
        {
            mForm2Prefab = Resources.Load<GameObject>("FormBox2");
            mFormRoot = GameObject.Find("FormRoot").transform;
        }
        return GameObject.Instantiate(mForm2Prefab, mFormRoot);
    }
}
